Rescue ArgumentError leaked from the date filter

This monkey-patches a bug in Liquid filed at Shopify/liquid#632.

Fixes #933.

Akinori MUSHA 9 ans auparavant
Parent
Commettre
5271f173ea
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 6 0
      app/concerns/liquid_interpolatable.rb

+ 6 - 0
app/concerns/liquid_interpolatable.rb

@@ -218,6 +218,12 @@ module LiquidInterpolatable
218 218
       input.to_s.sub(Regexp.new(regex), unescape_replacement(replacement.to_s))
219 219
     end
220 220
 
221
+    def date(input, format)
222
+      super
223
+    rescue ArgumentError
224
+      input
225
+    end
226
+
221 227
     private
222 228
 
223 229
     def logger